/* 后台主页路由
 * @Author: mikey.zhaopeng 
 * @Date: 2018-08-21 17:08:19 
 * @Last Modified by: Leil
 * @Last Modified time: 2018-09-06 10:06:18
 */
const express = require('express')
const router = express.Router()
const categoryModel = require('../models/category')

router.use((req, res, next) => {
    console.log("Check login......")
    console.log(req.session.user)
    if (!req.session.user) {
        req.flash('error', '未登录')
        return res.redirect('/login')
    }
    next()
})

router.get('/', (req, res) => {
    res.render('admin/index')
})

module.exports = router